package com.lanbu.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lanbu.common.annotation.Log;
import com.lanbu.common.core.controller.BaseController;
import com.lanbu.common.core.domain.AjaxResult;
import com.lanbu.common.enums.BusinessType;
import com.lanbu.system.domain.ZntStepScore;
import com.lanbu.system.service.IZntStepScoreService;
import com.lanbu.common.utils.poi.ExcelUtil;
import com.lanbu.common.core.page.TableDataInfo;

/**
 * 操作步骤得分Controller
 *
 * @author lanbu
 * @date 2025-04-24
 */
@Api(tags = "操作步骤得分Controller")
@RestController
@RequestMapping("/chat/score")
public class ZntStepScoreController extends BaseController
{
    @Autowired
    private IZntStepScoreService zntStepScoreService;


    @ApiOperation("查询操作步骤得分列表")
    @PreAuthorize("@ss.hasPermi('chat:score:list')")
    @GetMapping("/list")
    public TableDataInfo list(ZntStepScore zntStepScore)
    {
        startPage();
        List<ZntStepScore> list = zntStepScoreService.selectZntStepScoreList(zntStepScore);
        return getDataTable(list);
    }


    @ApiOperation("导出操作步骤得分列表")
    @PreAuthorize("@ss.hasPermi('chat:score:export')")
    @Log(title = "操作步骤得分", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZntStepScore zntStepScore)
    {
        List<ZntStepScore> list = zntStepScoreService.selectZntStepScoreList(zntStepScore);
        ExcelUtil<ZntStepScore> util = new ExcelUtil<ZntStepScore>(ZntStepScore.class);
        util.exportExcel(response, list, "操作步骤得分数据");
    }


    @ApiOperation("获取操作步骤得分详细信息")
    @PreAuthorize("@ss.hasPermi('chat:score:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zntStepScoreService.selectZntStepScoreById(id));
    }


    @ApiOperation("新增操作步骤得分")
    @PreAuthorize("@ss.hasPermi('chat:score:add')")
    @Log(title = "操作步骤得分", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZntStepScore zntStepScore)
    {
        return toAjax(zntStepScoreService.insertZntStepScore(zntStepScore));
    }

    @ApiOperation("修改操作步骤得分")
    @PreAuthorize("@ss.hasPermi('chat:score:edit')")
    @Log(title = "操作步骤得分", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZntStepScore zntStepScore)
    {
        return toAjax(zntStepScoreService.updateZntStepScore(zntStepScore));
    }


    @ApiOperation("删除操作步骤得分")
    @PreAuthorize("@ss.hasPermi('chat:score:remove')")
    @Log(title = "操作步骤得分", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zntStepScoreService.deleteZntStepScoreByIds(ids));
    }
}
